package com.mobileares.midp.widgets.client.page;

import com.google.gwt.user.client.ui.Widget;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: Tom
 * Date: 2011-6-2
 * Time: 16:40:26
 * To change this template use File | Settings | File Templates.
 */
public abstract class ItemModel implements HasAccess, IFunctionModel {
    private Widget widget;
    private int index = 9999;
    public List<CacheDateCallBack> backs = new ArrayList<CacheDateCallBack>();

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    public void addCacheCallBack(CacheDateCallBack callback) {
        backs.add(callback);
    }

    public List<CacheDateCallBack> getBacks() {
        return backs;
    }

    public Widget getWidget() {
        return widget;
    }

    public void setWidget(Widget widget) {
        this.widget = widget;
    }


    public interface CacheDateCallBack {
        void process();
    }
}
